package di.ass.main.helps;

import di.ass.R;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class ListIconHelpAdapter extends ArrayAdapter<String> {

	private final Context context;
	private final String[] values;

	public ListIconHelpAdapter(Context context, String[] values) {
		super(context, R.layout.help_icons, values);
		this.context = context;
		this.values = values;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		LayoutInflater inflater = (LayoutInflater) context
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View rowView = inflater.inflate(R.layout.help_icons, parent, false);
		TextView textView = (TextView) rowView.findViewById(R.id.label);
		ImageView imageView = (ImageView) rowView.findViewById(R.id.logo);
		textView.setText(values[position]);

		switch (position) {
		case 0:
			imageView.setImageResource(R.drawable.start_normal);
			break;
		case 1:
			imageView.setImageResource(R.drawable.help);
			break;
		case 2:
			imageView.setImageResource(R.drawable.setting);
			break;
		case 3:
			imageView.setImageResource(R.drawable.add);
			break;
		case 4:
			imageView.setImageResource(R.drawable.delete);
			break;
		case 5:
			imageView.setImageResource(R.drawable.formula_full);
			break;
		case 6:
			imageView.setImageResource(R.drawable.formula_not_full);
			break;
		case 7:
			imageView.setImageResource(R.drawable.formula_empty);
			break;
		case 8:
			imageView.setImageResource(R.drawable.check_all);
			break;
		case 9:
			imageView.setImageResource(R.drawable.filter);
			break;
		default:
			break;
		}
		return rowView;
	}
}
